package com.qcby.llmtchstd.service.Impl;

import com.qcby.llmtchstd.common.ResponseResult;
import com.qcby.llmtchstd.dao.ExamResultDao;
import com.qcby.llmtchstd.entity.exam_result;
import com.qcby.llmtchstd.service.ExamResultService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ExamResultServiceImpl implements ExamResultService {

    @Autowired
    private ExamResultDao examResultDao;

    @Override
    public ResponseResult<List<exam_result>> getExamResultsByStudentId(Integer studentId) {
        try {
            List<exam_result> results = examResultDao.findByStudentId(studentId);
            return ResponseResult.success(results);
        } catch (Exception e) {
            return ResponseResult.fail("5001","异常");
        }
    }
}
